import { LoginAPI, getImgAPI } from '@/api/user'
export default {
  // token 加入Vuex
  namespaced: true,
  state: {
    token: null
  },
  mutations: {
    setToken(state, token) {
      state.token = token
    },
    removeToken(state) {
      state.token = null
    }
  },
  actions: {
    async getImg() {
      const res = await getImgAPI()
      console.log(res)
    },
    async getLoginInfo({ commit }, data) {
      const res = await LoginAPI(data)
      console.log('请求体', res)
      // commit('setToken', res)
    }
  }
}
